﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Streambolics.Hp41s
{
    public static class StandardKeyboards
    {
        private static KeyboardMapping _Plain;
        private static KeyboardMapping _Shifted;
        private static AlphaKeyboardMapping _Alpha;
        private static AlphaKeyboardMapping _ShiftedAlpha;

        public static KeyboardMapping Plain
        {
            get
            {
                if (_Plain == null)
                {
                    _Plain = new KeyboardMapping ();
                    _Plain.Assign (KeyReference.User, SystemInstructions.ToggleUser);
                    _Plain.Assign (KeyReference.Enter, CommonInstructions.Enter);
                }
                return _Plain;
            }
        }

        public static KeyboardMapping Shifted
        {
            get
            {
                if (_Shifted == null)
                {
                    _Shifted = new KeyboardMapping (Plain);
                }
                return _Shifted;
            }
        }

        public static AlphaKeyboardMapping Alpha
        {
            get
            {
                if (_Alpha == null)
                {
                    _Alpha = new AlphaKeyboardMapping (false);
                    _Alpha.AssignChars (21, "A", "B", "C", "D", "E");
                }
                return _Alpha;
            }
        }

        public static AlphaKeyboardMapping ShiftedAlpha
        {
            get
            {
                if (_ShiftedAlpha == null)
                {
                    _ShiftedAlpha = new AlphaKeyboardMapping (true);
                }
                return _ShiftedAlpha;
            }
        }
    }
}
